import axios from 'axios'
export const createList = res => {
  return (dispatch, getState) => {
    dispatch({
      type: 'getGoods',
      list: res
    })
  }
}

export const getGoodsDetail = () => {
  return (dispatch, getState) => {
    axios.get('http://www.hangowa.com/mo_bile/index.php?act=index&op=special&special_id=1').then(response => {
      let res = response.data;
      if (res.code === 200) {
        dispatch(createList(res))
      } else {
        console.log(res.message)
      }
    })
  }
}
